/*******************************************************************************
* Adapted from "Beginning Linux Programming", from Wrox Press -- www.wrox.com
*******************************************************************************/
/*******************************************************************************
** $RCSfile: keyboard.h,v $ $Revision: 1.1 $ $State: Exp $
*******************************************************************************/

// Utility to allow keyboard input without blocking

#ifndef MYKBHIT_H_
#define MYKBHIT_H_

#ifndef WIN32
#include <termios.h>
#endif

class keyboard
{
public:

   keyboard();

   ~keyboard();

   // Returns 1 if keyboard input is ready; otherwise, 0
   int kbhit();

   // Returns character from keyboard if avaialable; otherwise, 0
   int keybrdTick();

protected:

   // Return character from keyboard input
   int getkey();

private:

#ifndef WIN32
   struct termios initial_settings, new_settings;
   int peek_character;
#endif

};


#endif

